const app = getApp();
var that;
var url_id;
Page({
  data: {
    array: [1, 2, 3, 4],
  },
  onLoad: function (options) {
    that = this;
    wx.setNavigationBarTitle({
      title: '磅单图片'
    });
    url_id = options.id;
    this.setData({
      id: url_id
    })
    search();
  },
  //检测下拉刷新事件
  onPullDownRefresh: function () {
    search();
    wx.stopPullDownRefresh();
  },
})
//查询
function search() {
  wx.request({
    url: app.serverIP + '/kkl/cms/app/fileInfo/lookup?fromId=' + url_id + '&token=' + app.token,
    dataType: "json",
    success: function (res) {
      if (res.data.code == "200") {
        var array = [];
        for (var key in res.data.data) {
          res.data.data[key].path = app.serverIP + res.data.data[key].path;
          array.push(res.data.data[key]);
        }
        that.setData({
          array: res.data.data
        });

      } else {
        console.log("没有找到上传的磅单信息")
      }
    },
  })
}